<?php
Loader::loadClass('ObjectUtilEx', "modules/DeGIS/pnincludes");
Loader::loadClass('DateUtilEx', "modules/DeGIS/pnincludes");
Loader::loadClass('PNObjectEx', "modules/DeGIS/pnincludes");
Loader::loadClass('PNObjectExArray', "modules/DeGIS/pnincludes");
Loader::loadClass('DBUtilEx', "modules/DeGIS/pnincludes");
Loader::loadClass('InnoUtil', "modules/DeGIS/pnincludes");
Loader::loadFile('config.php', 'modules/DeGIS');
function DeGIS_pntables()
{
    // Initialise table array
    $pntable = array();

    ////////////////////////////////////////////
    //table definition category
    ////////////////////////////////////////////
    $pntable['degis_developer'] = DBUtil::getLimitedTablename('degis_developer');
    $pntable['degis_developer_column'] = array(
                                        'id'                => 'dev_id',
                                        'uid'               => 'dev_uid',
                                        'firstname'         => 'dev_firstname',
                                        'lastname'          => 'dev_lastname',
                                        'phone'             => 'dev_phone',
                                        'company'           => 'dev_company',
                                        'companyurl'        => 'dev_companyurl',
                                        'address'           => 'dev_address',
                                        'district'          => 'dev_district',
                                        'province'          => 'dev_province',
                                        'country'           => 'dev_country',
                                        'zipcode'           => 'dev_zipcode'
    );
    $pntable['degis_developer_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'uid'               => 'INT(11) NOTNULL',
                                        'firstname'         => 'varchar(255)',
                                        'lastname'          => 'varchar(255)',
                                        'phone'             => 'varchar(50)',
                                        'company'           => 'varchar(50)',
                                        'companyurl'        => 'TEXT',
                                        'address'           => 'varchar(255)',
                                        'district'          => 'varchar(50)',
                                        'province'          => 'varchar(50)',
                                        'country'           => 'varchar(50)',
                                        'zipcode'           => 'varchar(50)',
                                        'validate_province' => 'dev_setting_province'
    );
    $pntable['degis_developer_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['degis_developer_column'], 'dev_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['degis_developer_column_def']);

    ////////////////////////////////////////////
    //table definition layer
    ////////////////////////////////////////////
    $pntable['degis_layer'] = DBUtil::getLimitedTablename('degis_layer');
    $pntable['degis_layer_column'] = array(
                                        'id'                => 'lay_id',
                                        'uid'               => 'lay_uid',
                                        'name'              => 'lay_name',
                                        'description'       => 'lay_description',
                                        'url'               => 'lay_url',
                                        'country'           => 'lay_country',
                                        'publisher'         => 'lay_publisher'
    );
    $pntable['degis_layer_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'uid'               => 'INT(11) NOTNULL ',
                                        'name'              => 'varchar(50)',
                                        'description'       => 'TEXT',
                                        'url'               => 'TEXT',
                                        'country'           => 'varchar(50)',
                                        'publisher'         => 'varchar(255)',
                                        'validate_province' => 'TEXT'
    );
    $pntable['degis_layer_primary_key_column'] = 'id';

    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['degis_layer_column'], 'lay_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['degis_layer_column_def']);

    return $pntable;
}